check if a string is a palindrome

76

check if a string is a palindrome -

int length = myString.Length;
for (int i = 0; i < length / 2; i++)
{
    if (myString[i] != myString[length - i - 1])
        return false;
}
return true;

Comments

Submit
0 Comments